home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / CommResources.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  11.4 KB  |  437 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        CommResources.a
  3. ;
  4. ;    Contains:    Communications Toolbox Resource Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1988-1993, 1995-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__COMMRESOURCES__') = 'UNDEFINED' THEN
  19. __COMMRESOURCES__ SET 1
  20.  
  21.     IF &TYPE('__OSUTILS__') = 'UNDEFINED' THEN
  22.     include 'OSUtils.a'
  23.     ENDIF
  24.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  25.     include 'ConditionalMacros.a'
  26.     ENDIF
  27.  
  28.  
  29.                                                             ;    tool classes (also the tool file types)    
  30. classCM                            EQU        'cbnd'
  31. classFT                            EQU        'fbnd'
  32. classTM                            EQU        'tbnd'
  33.  
  34.                                                             ;    version of the Comm Resource Manager    
  35. curCRMVersion                    EQU        2                    ; constants general to the use of the Communications Resource Manager 
  36. crmType                            EQU        9                    ; queue type    
  37. crmRecVersion                    EQU        1                    ; version of queue structure 
  38.                                                             ;    error codes 
  39. crmGenericError                    EQU        -1
  40. crmNoErr                        EQU        0
  41. ;  data structures general to the use of the Communications Resource Manager 
  42. ; typedef OSErr                         CRMErr
  43.  
  44. CRMRec                    RECORD 0
  45. qLink                     ds.l    1                ; offset: $0 (0)        ; reserved
  46. qType                     ds.w    1                ; offset: $4 (4)        ; queue type -- ORD(crmType) = 9
  47. crmVersion                 ds.w    1                ; offset: $6 (6)        ; version of queue element data structure
  48. crmPrivate                 ds.l    1                ; offset: $8 (8)        ; reserved
  49. crmReserved                 ds.w    1                ; offset: $C (12)        ; reserved
  50. crmDeviceType             ds.l    1                ; offset: $E (14)        ; type of device, assigned by DTS
  51. crmDeviceID                 ds.l    1                ; offset: $12 (18)        ; device ID; assigned when CRMInstall is called
  52. crmAttributes             ds.l    1                ; offset: $16 (22)        ; pointer to attribute block
  53. crmStatus                 ds.l    1                ; offset: $1A (26)        ; status variable - device specific
  54. crmRefCon                 ds.l    1                ; offset: $1E (30)        ; for device private use
  55. sizeof                     EQU *                    ; size:   $22 (34)
  56.                         ENDR
  57. ; typedef struct CRMRec *                CRMRecPtr
  58.  
  59. ;
  60. ; pascal CRMErr InitCRM(void )
  61. ;
  62.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  63.         Macro
  64.         _InitCRM
  65.             move.w              #$0501,-(sp)
  66.             move.l              sp,A0
  67.             dc.w                $A08B
  68.             addq.w              #2,sp
  69.         EndM
  70.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  71.         IMPORT_CFM_FUNCTION InitCRM
  72.     ENDIF
  73.  
  74. ;
  75. ; pascal QHdrPtr CRMGetHeader(void )
  76. ;
  77.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  78.         Macro
  79.         _CRMGetHeader
  80.             move.w              #$0502,-(sp)
  81.             move.l              sp,A0
  82.             dc.w                $A08B
  83.             addq.w              #2,sp
  84.         EndM
  85.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  86.         IMPORT_CFM_FUNCTION CRMGetHeader
  87.     ENDIF
  88.  
  89. ;
  90. ; pascal void CRMInstall(CRMRecPtr crmReqPtr)
  91. ;
  92.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  93.         Macro
  94.         _CRMInstall
  95.             move.w              #$0503,-(sp)
  96.             move.l              sp,A0
  97.             dc.w                $A08B
  98.             addq.w              #2,sp
  99.         EndM
  100.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  101.         IMPORT_CFM_FUNCTION CRMInstall
  102.     ENDIF
  103.  
  104. ;
  105. ; pascal OSErr CRMRemove(CRMRecPtr crmReqPtr)
  106. ;
  107.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  108.         Macro
  109.         _CRMRemove
  110.             move.w              #$0504,-(sp)
  111.             move.l              sp,A0
  112.             dc.w                $A08B
  113.             addq.w              #2,sp
  114.         EndM
  115.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  116.         IMPORT_CFM_FUNCTION CRMRemove
  117.     ENDIF
  118.  
  119. ;
  120. ; pascal CRMRecPtr CRMSearch(CRMRecPtr crmReqPtr)
  121. ;
  122.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  123.         Macro
  124.         _CRMSearch
  125.             move.w              #$0505,-(sp)
  126.             move.l              sp,A0
  127.             dc.w                $A08B
  128.             addq.w              #2,sp
  129.         EndM
  130.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  131.         IMPORT_CFM_FUNCTION CRMSearch
  132.     ENDIF
  133.  
  134. ;
  135. ; pascal short CRMGetCRMVersion(void )
  136. ;
  137.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  138.         Macro
  139.         _CRMGetCRMVersion
  140.             move.w              #$0506,-(sp)
  141.             move.l              sp,A0
  142.             dc.w                $A08B
  143.             addq.w              #2,sp
  144.         EndM
  145.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  146.         IMPORT_CFM_FUNCTION CRMGetCRMVersion
  147.     ENDIF
  148.  
  149. ;
  150. ; pascal Handle CRMGetResource(ResType theType, short theID)
  151. ;
  152.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  153.         Macro
  154.         _CRMGetResource
  155.             move.w              #$0507,-(sp)
  156.             move.l              sp,A0
  157.             dc.w                $A08B
  158.             addq.w              #2,sp
  159.         EndM
  160.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  161.         IMPORT_CFM_FUNCTION CRMGetResource
  162.     ENDIF
  163.  
  164. ;
  165. ; pascal Handle CRMGet1Resource(ResType theType, short theID)
  166. ;
  167.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  168.         Macro
  169.         _CRMGet1Resource
  170.             move.w              #$0508,-(sp)
  171.             move.l              sp,A0
  172.             dc.w                $A08B
  173.             addq.w              #2,sp
  174.         EndM
  175.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  176.         IMPORT_CFM_FUNCTION CRMGet1Resource
  177.     ENDIF
  178.  
  179. ;
  180. ; pascal Handle CRMGetIndResource(ResType theType, short index)
  181. ;
  182.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  183.         Macro
  184.         _CRMGetIndResource
  185.             move.w              #$0509,-(sp)
  186.             move.l              sp,A0
  187.             dc.w                $A08B
  188.             addq.w              #2,sp
  189.         EndM
  190.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  191.         IMPORT_CFM_FUNCTION CRMGetIndResource
  192.     ENDIF
  193.  
  194. ;
  195. ; pascal Handle CRMGet1IndResource(ResType theType, short index)
  196. ;
  197.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  198.         Macro
  199.         _CRMGet1IndResource
  200.             move.w              #$050A,-(sp)
  201.             move.l              sp,A0
  202.             dc.w                $A08B
  203.             addq.w              #2,sp
  204.         EndM
  205.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  206.         IMPORT_CFM_FUNCTION CRMGet1IndResource
  207.     ENDIF
  208.  
  209. ;
  210. ; pascal Handle CRMGetNamedResource(ResType theType, ConstStr255Param name)
  211. ;
  212.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  213.         Macro
  214.         _CRMGetNamedResource
  215.             move.w              #$050B,-(sp)
  216.             move.l              sp,A0
  217.             dc.w                $A08B
  218.             addq.w              #2,sp
  219.         EndM
  220.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  221.         IMPORT_CFM_FUNCTION CRMGetNamedResource
  222.     ENDIF
  223.  
  224. ;
  225. ; pascal Handle CRMGet1NamedResource(ResType theType, ConstStr255Param name)
  226. ;
  227.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  228.         Macro
  229.         _CRMGet1NamedResource
  230.             move.w              #$050C,-(sp)
  231.             move.l              sp,A0
  232.             dc.w                $A08B
  233.             addq.w              #2,sp
  234.         EndM
  235.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  236.         IMPORT_CFM_FUNCTION CRMGet1NamedResource
  237.     ENDIF
  238.  
  239. ;
  240. ; pascal void CRMReleaseResource(Handle theHandle)
  241. ;
  242.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  243.         Macro
  244.         _CRMReleaseResource
  245.             move.w              #$050D,-(sp)
  246.             move.l              sp,A0
  247.             dc.w                $A08B
  248.             addq.w              #2,sp
  249.         EndM
  250.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  251.         IMPORT_CFM_FUNCTION CRMReleaseResource
  252.     ENDIF
  253.  
  254. ;
  255. ; pascal Handle CRMGetToolResource(short procID, ResType theType, short theID)
  256. ;
  257.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  258.         Macro
  259.         _CRMGetToolResource
  260.             move.w              #$0523,-(sp)
  261.             move.l              sp,A0
  262.             dc.w                $A08B
  263.             addq.w              #2,sp
  264.         EndM
  265.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  266.         IMPORT_CFM_FUNCTION CRMGetToolResource
  267.     ENDIF
  268.  
  269. ;
  270. ; pascal Handle CRMGetToolNamedResource(short procID, ResType theType, ConstStr255Param name)
  271. ;
  272.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  273.         Macro
  274.         _CRMGetToolNamedResource
  275.             move.w              #$0526,-(sp)
  276.             move.l              sp,A0
  277.             dc.w                $A08B
  278.             addq.w              #2,sp
  279.         EndM
  280.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  281.         IMPORT_CFM_FUNCTION CRMGetToolNamedResource
  282.     ENDIF
  283.  
  284. ;
  285. ; pascal void CRMReleaseToolResource(short procID, Handle theHandle)
  286. ;
  287.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  288.         Macro
  289.         _CRMReleaseToolResource
  290.             move.w              #$0524,-(sp)
  291.             move.l              sp,A0
  292.             dc.w                $A08B
  293.             addq.w              #2,sp
  294.         EndM
  295.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  296.         IMPORT_CFM_FUNCTION CRMReleaseToolResource
  297.     ENDIF
  298.  
  299. ;
  300. ; pascal long CRMGetIndex(Handle theHandle)
  301. ;
  302.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  303.         Macro
  304.         _CRMGetIndex
  305.             move.w              #$050E,-(sp)
  306.             move.l              sp,A0
  307.             dc.w                $A08B
  308.             addq.w              #2,sp
  309.         EndM
  310.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  311.         IMPORT_CFM_FUNCTION CRMGetIndex
  312.     ENDIF
  313.  
  314. ;
  315. ; pascal short CRMLocalToRealID(ResType bundleType, short toolID, ResType theType, short localID)
  316. ;
  317.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  318.         Macro
  319.         _CRMLocalToRealID
  320.             move.w              #$050F,-(sp)
  321.             move.l              sp,A0
  322.             dc.w                $A08B
  323.             addq.w              #2,sp
  324.         EndM
  325.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  326.         IMPORT_CFM_FUNCTION CRMLocalToRealID
  327.     ENDIF
  328.  
  329. ;
  330. ; pascal short CRMRealToLocalID(ResType bundleType, short toolID, ResType theType, short realID)
  331. ;
  332.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  333.         Macro
  334.         _CRMRealToLocalID
  335.             move.w              #$0510,-(sp)
  336.             move.l              sp,A0
  337.             dc.w                $A08B
  338.             addq.w              #2,sp
  339.         EndM
  340.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  341.         IMPORT_CFM_FUNCTION CRMRealToLocalID
  342.     ENDIF
  343.  
  344. ;
  345. ; pascal OSErr CRMGetIndToolName(OSType bundleType, short index, Str255 toolName)
  346. ;
  347.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  348.         Macro
  349.         _CRMGetIndToolName
  350.             move.w              #$0511,-(sp)
  351.             move.l              sp,A0
  352.             dc.w                $A08B
  353.             addq.w              #2,sp
  354.         EndM
  355.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  356.         IMPORT_CFM_FUNCTION CRMGetIndToolName
  357.     ENDIF
  358.  
  359. ;
  360. ; pascal OSErr CRMFindCommunications(short *vRefNum, long *dirID)
  361. ;
  362.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  363.         Macro
  364.         _CRMFindCommunications
  365.             move.w              #$051A,-(sp)
  366.             move.l              sp,A0
  367.             dc.w                $A08B
  368.             addq.w              #2,sp
  369.         EndM
  370.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  371.         IMPORT_CFM_FUNCTION CRMFindCommunications
  372.     ENDIF
  373.  
  374. ;
  375. ; pascal Boolean CRMIsDriverOpen(ConstStr255Param driverName)
  376. ;
  377.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  378.         Macro
  379.         _CRMIsDriverOpen
  380.             move.w              #$0521,-(sp)
  381.             move.l              sp,A0
  382.             dc.w                $A08B
  383.             addq.w              #2,sp
  384.         EndM
  385.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  386.         IMPORT_CFM_FUNCTION CRMIsDriverOpen
  387.     ENDIF
  388.  
  389. ;
  390. ; pascal CRMErr CRMParseCAPSResource(Handle theHandle, ResType selector, unsigned long *value)
  391. ;
  392.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  393.         Macro
  394.         _CRMParseCAPSResource
  395.             move.w              #$0525,-(sp)
  396.             move.l              sp,A0
  397.             dc.w                $A08B
  398.             addq.w              #2,sp
  399.         EndM
  400.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  401.         IMPORT_CFM_FUNCTION CRMParseCAPSResource
  402.     ENDIF
  403.  
  404. ;
  405. ; pascal OSErr CRMReserveRF(short refNum)
  406. ;
  407.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  408.         Macro
  409.         _CRMReserveRF
  410.             move.w              #$0513,-(sp)
  411.             move.l              sp,A0
  412.             dc.w                $A08B
  413.             addq.w              #2,sp
  414.         EndM
  415.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  416.         IMPORT_CFM_FUNCTION CRMReserveRF
  417.     ENDIF
  418.  
  419. ;
  420. ; pascal OSErr CRMReleaseRF(short refNum)
  421. ;
  422.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  423.         Macro
  424.         _CRMReleaseRF
  425.             move.w              #$0514,-(sp)
  426.             move.l              sp,A0
  427.             dc.w                $A08B
  428.             addq.w              #2,sp
  429.         EndM
  430.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  431.         IMPORT_CFM_FUNCTION CRMReleaseRF
  432.     ENDIF
  433.  
  434.  
  435.     ENDIF ; __COMMRESOURCES__ 
  436.  
  437.